/*
Copyright 2010  Murali Devi (profdevi@gmail.com)

This file is part of ComineGL Project.

ComineGL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

ComineGL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with ComineGL.  If not, see <http://www.gnu.org/licenses/>.

This code uses the irrlicht and irrklang libraries.  Please read
the libraries copyrights at 

	irrlicht library:  http://irrlicht.sourceforge.net
	irrklang library:  http://www.ambiera.com/irrklang

*/



//v0.14 copyright Comine.com 20101212U01
#ifndef ComineGLNode_h
#define ComineGLNode_h

///////////////////////////////////////////
#include "ComineGLDefines.h"

///////////////////////////////////////////
// Node Load Operations
MDLLFUN bool CGLNodeLoadCube(int nodeid,float size);
MDLLFUN bool CGLNodeLoadCamera(int nodeid,float farplanedistance=3000.0f);
MDLLFUN bool CGLNodeLoadCameraFPS(int nodeid,float farplanedistance=3000.0f,
		float rotatespeed=50.0f,float movespeed=0.5f,bool vertmove=true);
MDLLFUN bool CGLNodeLoadMesh(int nodeid,int meshid);
MDLLFUN bool CGLNodeLoadSkyBox(int nodeid,int texfront,int texback,int texleft,int texright,int texup,int texdown);
MDLLFUN bool CGLNodeLoadEmpty(int nodeid);
MDLLFUN bool CGLNodeLoadWater(int nodeid,int meshid,float height=5.0f,float speed=300.0f,float length=10.0f);
MDLLFUN bool CGLNodeLoadBillboard(int nodeid,float width=50.0f,float height=50.0f);
MDLLFUN bool CGLNodeLoadFontText(int nodeid,int fontid,int size,const char *fmt,...);
MDLLFUN bool CGLNodeLoadSkyDome(int nodeid,int textureid,float fov=360);
MDLLFUN bool CGLNodeLoadTerrain(int nodeid,const char *terrain);

// Node Check if id exists
MDLLFUN bool CGLNodeExists(int nodeid);

// Node Unload Operations
MDLLFUN bool CGLNodeUnload(int nodeid);
MDLLFUN bool CGLNodeUnloadAll(void);
MDLLFUN int CGLNodeGetCount(void);

// Node Dynamics Operations
MDLLFUN bool CGLNodeSetPosition(int nodeid,float x,float y,float z);
MDLLFUN bool CGLNodeGetPosition(int nodeid,float &x,float &y,float &z);
MDLLFUN bool CGLNodeGetAbsolutePosition(int nodeid,float &x,float &y,float &z);
MDLLFUN bool CGLNodeSetRotation(int nodeid,float rx,float ry,float rz);
MDLLFUN bool CGLNodeGetRotation(int nodeid,float &rx,float &ry,float &rz);
MDLLFUN bool CGLNodeAddPosition(int nodeid,float dx,float dy,float dz);
MDLLFUN bool CGLNodeGetUpVector(int nodeid,float &nx,float &ny,float &nz);
MDLLFUN bool CGLNodeGetFrontVector(int nodeid,float &nx,float &ny,float &nz);
MDLLFUN bool CGLNodeGetRightVector(int nodeid,float &nx,float &ny,float &nz);

// Extra Functions
MDLLFUN bool CGLNodeSetTexture(int nodeid,int texid,int layer=0);
MDLLFUN bool CGLNodeSetScale(int nodeid,float sx,float sy,float sz);
MDLLFUN bool CGLNodeSetParent(int nodeid,int newparent,bool keeprelativeposition=false);
MDLLFUN bool CGLNodeSetParentRoot(int nodeid,bool keeprelativeposition=false);
MDLLFUN bool CGLNodeSetVisible(int nodeid,bool visible);
MDLLFUN bool CGLNodeIsVisible(int nodeid);

// Camera Operations
MDLLFUN bool CGLNodeCameraSetActive(int nodeid);
MDLLFUN bool CGLNodeCameraLookAt(int nodeid,float x,float y,float z);


// Animators
MDLLFUN bool CGLNodeAnimatorClearAll(int nodeid);
MDLLFUN bool CGLNodeAnimatorAddRotation(int nodeid,float rx,float ry,float rz);
MDLLFUN bool CGLNodeAnimatorAddVelocity(int nodeid,float vx,float vy,float vz);
MDLLFUN bool CGLNodeAnimatorAddMoveTo(int nodeid,float x,float y,float z,unsigned int timems);
MDLLFUN bool CGLNodeAnimatorAddCollisionResponse(int nodeid,int nodemapid,int meshid
		,int polycount=32,float nodesize=50.0,float gravity=0);
MDLLFUN bool CGLNodeAnimatorAddCollisionResponseTerrain(int nodeid,int terrainnodeid,float gravity);

// Axis Aligned Bounded Box Functions
MDLLFUN bool CGLNodeAABBEnable(int nodeid,bool visible);	
MDLLFUN bool CGLNodeAABBHitTestNodes(int nodeid1,int nodeid2);
MDLLFUN bool CGLNodeAABBHitTestPoint(int nodeid,float x,float y,float z);

#endif // ComineGLNode_h
